package org.sas.example.authentication.wechat;

import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;

import java.util.Arrays;

/**
 * 微信用户信息响应转换器
 *
 * @author LiJY
 * @date 2024/07/11
 */
public class WechatUserResponseConverter extends MappingJackson2HttpMessageConverter {

    public WechatUserResponseConverter() {
        // 微信获取用户信息时响应的类型为“text/plain”，这里特殊处理一下
        super.setSupportedMediaTypes(Arrays.asList(MediaType.APPLICATION_JSON,
                MediaType.TEXT_PLAIN,
                new MediaType("application", "*+json")));
    }

}
